<?php

namespace App\Listeners;

use App\Events\OrderFinished;
use App\Jobs\OrderNotice;
use App\Tool\NoticeType;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class OrderFinishedSmsNotification
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  OrderFinished  $event
     * @return void
     */
    public function handle(OrderFinished $event)
    {
        //
        dispatch(new OrderNotice(NoticeType::order_finished_notice,['no'=>$event->orderItem->order_no],$event->userItem->phone));

    }
}
